using AndyPike.Commons;
using AndyPike.Commons.Persistence;
using AndyPike.Snowflake.Core.Messages;
using AndyPike.Snowflake.Entities;

namespace AndyPike.Snowflake.Core.Mappers
{
    public class RegistrationMessageToAccountMapper : IMessageToEntityMapper<RegistrationMessage, Account>
    {
        public Account Map(RegistrationMessage message)
        {
            GuardAgainst.ArgumentNull(message, "message");

            return new Account{UserName = message.UserName, Password = message.Password, Email = message.Email};
        }
    }
}